<template>
    <div class="cusYixiang body">
        <div class="userform">
            <!--基本信息-->
            <div class="msg">
                <!--<img :src="personImg" alt="">-->
                <p v-html="odata.name"></p>
                <p v-html="odata.mobile"></p>
                <div>
                    <dl>
                        <dd>{{ odata.wantMoney }}万</dd>
                        <dt>需求资金</dt>
                    </dl>
                    <span></span>
                    <dl>
                        <dd v-html="odata.loanType"></dd>
                        <dt>贷款类型</dt>
                    </dl>
                </div>
            </div>
            <div class="formlist">
                <p style="height: 0.2rem;"></p>
                <div class="formbox">
                    <dl>
                        <dd>需求额度</dd>
                        <dt>
                            <span>万元</span
                            ><input
                                type="text"
                                placeholder="请输入需求额度（必填）"
                                v-model="odata.wantMoney"
                            />
                        </dt>
                    </dl>
                    <dl>
                        <dd>贷款类型</dd>
                        <dt @click="pickershow('daikuan')">
                            <div class="picimg">
                                <img :src="jianimg" alt="" />
                            </div>
                            <div class="pciker">{{ odata.loanType }}</div>
                        </dt>
                        <awesome-picker
                            ref="daikuan"
                            id="daikuan1"
                            :data="daikuan.data"
                            :anchor="daikuan.anchor"
                            :textTitle="daikuan.textTitle"
                            :colorTitle="daikuan.colorTitle"
                            :colorConfirm="daikuan.colorConfirm"
                            :swipeTime="daikuan.swipeTime"
                            @confirm="pickerConfirm('daikuan', arguments)"
                        >
                        </awesome-picker>
                    </dl>
                    <dl>
                        <dd>住宅类型</dd>
                        <dt @click="pickershow('zhuzhai')">
                            <div class="picimg">
                                <img :src="jianimg" alt="" />
                            </div>
                            <div class="pciker">{{ odata.houseType }}</div>
                        </dt>
                        <awesome-picker
                            ref="zhuzhai"
                            :data="zhuzhai.data"
                            :anchor="zhuzhai.anchor"
                            :textTitle="zhuzhai.textTitle"
                            :colorTitle="zhuzhai.colorTitle"
                            :colorConfirm="zhuzhai.colorConfirm"
                            :swipeTime="zhuzhai.swipeTime"
                            @confirm="pickerConfirm('zhuzhai', arguments)"
                        >
                        </awesome-picker>
                    </dl>
                </div>
            </div>
            <!--房产信息-->
            <div class="formlist">
                <p>
                    <span>房产信息</span>
                    <i @click="fangshow = true" v-show="!fangshow"
                        ><img :src="jianimg" alt=""
                    /></i>
                    <i @click="fangshow = false" v-show="fangshow"
                        ><img class="jianup" :src="jianimg" alt=""
                    /></i>
                </p>
                <div class="formbox" v-show="fangshow">
                    <dl>
                        <dd>房产类型</dd>
                        <dt @click="pickershow('fangchan')">
                            <div class="picimg">
                                <img :src="jianimg" alt="" />
                            </div>
                            <div class="pciker">{{ odata.estateType }}</div>
                        </dt>
                        <awesome-picker
                            ref="fangchan"
                            :data="fangchan.data"
                            :anchor="fangchan.anchor"
                            :textTitle="fangchan.textTitle"
                            :colorTitle="fangchan.colorTitle"
                            :colorConfirm="fangchan.colorConfirm"
                            :swipeTime="fangchan.swipeTime"
                            @confirm="pickerConfirm('fangchan', arguments)"
                        >
                        </awesome-picker>
                    </dl>
                    <dl>
                        <dd>所在区域</dd>
                        <dt>
                            <input
                                type="text"
                                placeholder="请输房产所在区域"
                                v-model="odata.estateArea"
                            />
                        </dt>
                    </dl>
                    <dl>
                        <dd>建筑面积</dd>
                        <dt>
                            <span style="margin-left: 0.1rem;">m²</span
                            ><input
                                type="text"
                                placeholder="请输入房产建筑面积"
                                v-model="odata.estateRange"
                            />
                        </dt>
                    </dl>
                    <dl>
                        <dd>产权证</dd>
                        <dt @click="pickershow('fangCertificate')">
                            <div class="picimg">
                                <img :src="jianimg" alt="" />
                            </div>
                            <div class="pciker">{{ odata.estateFlag }}</div>
                        </dt>
                        <awesome-picker
                            ref="fangCertificate"
                            :data="fangCertificate.data"
                            :anchor="fangCertificate.anchor"
                            :textTitle="fangCertificate.textTitle"
                            :colorTitle="fangCertificate.colorTitle"
                            :colorConfirm="fangCertificate.colorConfirm"
                            :swipeTime="fangCertificate.swipeTime"
                            @confirm="
                                pickerConfirm('fangCertificate', arguments)
                            "
                        >
                        </awesome-picker>
                    </dl>
                    <dl>
                        <dd>购买方式</dd>
                        <dt @click="pickershow('fangbuytype')">
                            <div class="picimg">
                                <img :src="jianimg" alt="" />
                            </div>
                            <div class="pciker">{{ odata.estateStatus }}</div>
                        </dt>
                        <awesome-picker
                            ref="fangbuytype"
                            :data="fangbuytype.data"
                            :anchor="fangbuytype.anchor"
                            :textTitle="fangbuytype.textTitle"
                            :colorTitle="fangbuytype.colorTitle"
                            :colorConfirm="fangbuytype.colorConfirm"
                            :swipeTime="fangbuytype.swipeTime"
                            @confirm="pickerConfirm('fangbuytype', arguments)"
                        >
                        </awesome-picker>
                    </dl>
                </div>
            </div>
            <!--车辆信息-->
            <div class="formlist">
                <p>
                    <span>车辆信息</span>
                    <i @click="cheshow = true" v-show="!cheshow"
                        ><img :src="jianimg" alt=""
                    /></i>
                    <i @click="cheshow = false" v-show="cheshow"
                        ><img class="jianup" :src="jianimg" alt=""
                    /></i>
                </p>
                <div class="formbox" v-show="cheshow">
                    <dl>
                        <dd>品牌型号</dd>
                        <dt>
                            <input
                                type="text"
                                placeholder="请输车辆品牌型号"
                                v-model="odata.carType"
                            />
                        </dt>
                    </dl>
                    <dl>
                        <dd>车辆配置</dd>
                        <dt @click="pickershow('chePeizhi')">
                            <div class="picimg">
                                <img :src="jianimg" alt="" />
                            </div>
                            <div class="pciker">{{ odata.carLevel }}</div>
                        </dt>
                        <awesome-picker
                            ref="chePeizhi"
                            :data="chePeizhi.data"
                            :anchor="chePeizhi.anchor"
                            :textTitle="chePeizhi.textTitle"
                            :colorTitle="chePeizhi.colorTitle"
                            :colorConfirm="chePeizhi.colorConfirm"
                            :swipeTime="chePeizhi.swipeTime"
                            @confirm="pickerConfirm('chePeizhi', arguments)"
                        >
                        </awesome-picker>
                    </dl>
                    <dl>
                        <dd>购买年限</dd>
                        <dt @click="pickershow('cheYear')">
                            <div class="picimg">
                                <img :src="jianimg" alt="" />
                            </div>
                            <div class="pciker">{{ odata.carYear }}</div>
                        </dt>
                        <awesome-picker
                            ref="cheYear"
                            :data="cheYear.data"
                            :anchor="cheYear.anchor"
                            :textTitle="cheYear.textTitle"
                            :colorTitle="cheYear.colorTitle"
                            :colorConfirm="cheYear.colorConfirm"
                            :swipeTime="cheYear.swipeTime"
                            @confirm="pickerConfirm('cheYear', arguments)"
                        >
                        </awesome-picker>
                    </dl>
                    <dl>
                        <dd>购买价格</dd>
                        <dt>
                            <span style="margin-left: 0.1rem;">万元</span
                            ><input
                                type="text"
                                placeholder="请输入车辆购买价格"
                                v-model="odata.carPrice"
                            />
                        </dt>
                    </dl>
                    <dl>
                        <dd>购买方式</dd>
                        <dt @click="pickershow('cheBytype')">
                            <div class="picimg">
                                <img :src="jianimg" alt="" />
                            </div>
                            <div class="pciker">{{ odata.carBuyType }}</div>
                        </dt>
                        <awesome-picker
                            ref="cheBytype"
                            :data="cheBytype.data"
                            :anchor="cheBytype.anchor"
                            :textTitle="cheBytype.textTitle"
                            :colorTitle="cheBytype.colorTitle"
                            :colorConfirm="cheBytype.colorConfirm"
                            :swipeTime="cheBytype.swipeTime"
                            @confirm="pickerConfirm('cheBytype', arguments)"
                        >
                        </awesome-picker>
                    </dl>
                </div>
            </div>
            <!--保单信息-->
            <div class="formlist">
                <p>
                    <span>保单信息</span>
                    <i @click="baodanshow = true" v-show="!baodanshow"
                        ><img :src="jianimg" alt=""
                    /></i>
                    <i @click="baodanshow = false" v-show="baodanshow"
                        ><img class="jianup" :src="jianimg" alt=""
                    /></i>
                </p>
                <div class="formbox" v-show="baodanshow">
                    <dl>
                        <dd>保险公司</dd>
                        <dt>
                            <input
                                type="text"
                                placeholder="请输保险公司名称"
                                v-model="odata.safeCompany"
                            />
                        </dt>
                    </dl>
                    <dl>
                        <dd>保单类型</dd>
                        <dt @click="pickershow('baodanType')">
                            <div class="picimg">
                                <img :src="jianimg" alt="" />
                            </div>
                            <div class="pciker">{{ odata.safeType }}</div>
                        </dt>
                        <awesome-picker
                            ref="baodanType"
                            :data="baodanType.data"
                            :anchor="baodanType.anchor"
                            :textTitle="baodanType.textTitle"
                            :colorTitle="baodanType.colorTitle"
                            :colorConfirm="baodanType.colorConfirm"
                            :swipeTime="baodanType.swipeTime"
                            @confirm="pickerConfirm('baodanType', arguments)"
                        >
                        </awesome-picker>
                    </dl>
                    <dl>
                        <dd>缴存时间</dd>
                        <dt @click="pickershow('baodanJiaotime')">
                            <div class="picimg">
                                <img :src="jianimg" alt="" />
                            </div>
                            <div class="pciker">{{ odata.safeDeposit }}</div>
                        </dt>
                        <awesome-picker
                            ref="baodanJiaotime"
                            :data="baodanJiaotime.data"
                            :anchor="baodanJiaotime.anchor"
                            :textTitle="baodanJiaotime.textTitle"
                            :colorTitle="baodanJiaotime.colorTitle"
                            :colorConfirm="baodanJiaotime.colorConfirm"
                            :swipeTime="baodanJiaotime.swipeTime"
                            @confirm="
                                pickerConfirm('baodanJiaotime', arguments)
                            "
                        >
                        </awesome-picker>
                    </dl>
                    <dl>
                        <dd>缴费方式</dd>
                        <dt @click="pickershow('baodanJiaotype')">
                            <div class="picimg">
                                <img :src="jianimg" alt="" />
                            </div>
                            <div class="pciker">{{ odata.safePayType }}</div>
                        </dt>
                        <awesome-picker
                            ref="baodanJiaotype"
                            :data="baodanJiaotype.data"
                            :anchor="baodanJiaotype.anchor"
                            :textTitle="baodanJiaotype.textTitle"
                            :colorTitle="baodanJiaotype.colorTitle"
                            :colorConfirm="baodanJiaotype.colorConfirm"
                            :swipeTime="baodanJiaotype.swipeTime"
                            @confirm="
                                pickerConfirm('baodanJiaotype', arguments)
                            "
                        >
                        </awesome-picker>
                    </dl>
                    <dl>
                        <dd>是否断缴</dd>
                        <dt @click="pickershow('baodanOver')">
                            <div class="picimg">
                                <img :src="jianimg" alt="" />
                            </div>
                            <div class="pciker">{{ odata.safeFlag }}</div>
                        </dt>
                        <awesome-picker
                            ref="baodanOver"
                            :data="baodanOver.data"
                            :anchor="baodanOver.anchor"
                            :textTitle="baodanOver.textTitle"
                            :colorTitle="baodanOver.colorTitle"
                            :colorConfirm="baodanOver.colorConfirm"
                            :swipeTime="baodanOver.swipeTime"
                            @confirm="pickerConfirm('baodanOver', arguments)"
                        >
                        </awesome-picker>
                    </dl>
                </div>
            </div>
            <!--企业信息-->
            <div class="formlist">
                <p>
                    <span>企业信息</span>
                    <i @click="qiyeshow = true" v-show="!qiyeshow"
                        ><img :src="jianimg" alt=""
                    /></i>
                    <i @click="qiyeshow = false" v-show="qiyeshow"
                        ><img class="jianup" :src="jianimg" alt=""
                    /></i>
                </p>
                <div class="formbox" v-show="qiyeshow">
                    <dl>
                        <dd>注册时间</dd>
                        <dt>
                            <span style="margin-left: 0.1rem;">年</span
                            ><input
                                type="text"
                                placeholder="请输入企业注册时间"
                                v-model="odata.companyRegistTime"
                            />
                        </dt>
                    </dl>
                    <dl>
                        <dd>企业类型</dd>
                        <dt @click="pickershow('qiyeType')">
                            <div class="picimg">
                                <img :src="jianimg" alt="" />
                            </div>
                            <div class="pciker">{{ odata.companyType }}</div>
                        </dt>
                        <awesome-picker
                            ref="qiyeType"
                            :data="qiyeType.data"
                            :anchor="qiyeType.anchor"
                            :textTitle="qiyeType.textTitle"
                            :colorTitle="qiyeType.colorTitle"
                            :colorConfirm="qiyeType.colorConfirm"
                            :swipeTime="qiyeType.swipeTime"
                            @confirm="pickerConfirm('qiyeType', arguments)"
                        >
                        </awesome-picker>
                    </dl>
                    <dl>
                        <dd>经营项目</dd>
                        <dt>
                            <input
                                type="text"
                                placeholder="请输企业经营项目"
                                v-model="odata.companyProject"
                            />
                        </dt>
                    </dl>
                    <dl>
                        <dd>对公流水</dd>
                        <dt>
                            <span style="margin-left: 0.1rem;">万元</span
                            ><input
                                type="text"
                                placeholder="请输入对公流水"
                                v-model="odata.publicStream"
                            />
                        </dt>
                    </dl>
                    <dl>
                        <dd>个人流水</dd>
                        <dt>
                            <span style="margin-left: 0.1rem;">万元</span
                            ><input
                                type="text"
                                placeholder="请输入个人流水"
                                v-model="odata.personalStream"
                            />
                        </dt>
                    </dl>
                </div>
            </div>
            <!--工作信息-->
            <div class="formlist">
                <p>
                    <span>工作信息</span>
                    <i @click="jobshow = true" v-show="!jobshow"
                        ><img :src="jianimg" alt=""
                    /></i>
                    <i @click="jobshow = false" v-show="jobshow"
                        ><img class="jianup" :src="jianimg" alt=""
                    /></i>
                </p>
                <div class="formbox" v-show="jobshow">
                    <dl>
                        <dd>工作单位</dd>
                        <dt>
                            <span style="margin-left: 0.1rem;">年</span
                            ><input
                                type="text"
                                placeholder="请输入工作单位名称"
                                v-model="odata.workAddress"
                            />
                        </dt>
                    </dl>
                    <dl>
                        <dd>工资发放形式</dd>
                        <dt @click="pickershow('jobPaywages')">
                            <div class="picimg">
                                <img :src="jianimg" alt="" />
                            </div>
                            <div class="pciker">{{ odata.workSalaryType }}</div>
                        </dt>
                        <awesome-picker
                            ref="jobPaywages"
                            :data="jobPaywages.data"
                            :anchor="jobPaywages.anchor"
                            :textTitle="jobPaywages.textTitle"
                            :colorTitle="jobPaywages.colorTitle"
                            :colorConfirm="jobPaywages.colorConfirm"
                            :swipeTime="jobPaywages.swipeTime"
                            @confirm="pickerConfirm('jobPaywages', arguments)"
                        >
                        </awesome-picker>
                    </dl>
                    <dl>
                        <dd>月工资</dd>
                        <dt>
                            <span style="margin-left: 0.1rem;">元</span
                            ><input
                                type="text"
                                placeholder="请输入月工资"
                                v-model="odata.workSalary"
                            />
                        </dt>
                    </dl>
                    <dl>
                        <dd>工作年限</dd>
                        <dt>
                            <span style="margin-left: 0.1rem;">年</span
                            ><input
                                type="text"
                                placeholder="请输入工作年限"
                                v-model="odata.workAge"
                            />
                        </dt>
                    </dl>
                    <dl>
                        <dd>本地社保</dd>
                        <dt @click="pickershow('jobSocialsecurity')">
                            <div class="picimg">
                                <img :src="jianimg" alt="" />
                            </div>
                            <div class="pciker">
                                {{ odata.workLocalSocial }}
                            </div>
                        </dt>
                        <awesome-picker
                            ref="jobSocialsecurity"
                            :data="jobSocialsecurity.data"
                            :anchor="jobSocialsecurity.anchor"
                            :textTitle="jobSocialsecurity.textTitle"
                            :colorTitle="jobSocialsecurity.colorTitle"
                            :colorConfirm="jobSocialsecurity.colorConfirm"
                            :swipeTime="jobSocialsecurity.swipeTime"
                            @confirm="
                                pickerConfirm('jobSocialsecurity', arguments)
                            "
                        >
                        </awesome-picker>
                    </dl>
                    <dl>
                        <dd>本地公积金</dd>
                        <dt @click="pickershow('jobAccumulationfund')">
                            <div class="picimg">
                                <img :src="jianimg" alt="" />
                            </div>
                            <div class="pciker">
                                {{ odata.workLocalProvident }}
                            </div>
                        </dt>
                        <awesome-picker
                            ref="jobAccumulationfund"
                            :data="jobAccumulationfund.data"
                            :anchor="jobAccumulationfund.anchor"
                            :textTitle="jobAccumulationfund.textTitle"
                            :colorTitle="jobAccumulationfund.colorTitle"
                            :colorConfirm="jobAccumulationfund.colorConfirm"
                            :swipeTime="jobAccumulationfund.swipeTime"
                            @confirm="
                                pickerConfirm('jobAccumulationfund', arguments)
                            "
                        >
                        </awesome-picker>
                    </dl>
                </div>
            </div>
            <!--工作信息-->
            <div class="formlist">
                <div class="formbox">
                    <dl>
                        <dd>逾期情况</dd>
                        <dt>
                            <span style="margin-left: 0.1rem;">次</span
                            ><input
                                type="text"
                                placeholder="请输入逾期情况"
                                v-model="odata.workOverdue"
                            />
                        </dt>
                    </dl>
                    <dl>
                        <dd>备注</dd>
                        <dt>
                            <input
                                type="text"
                                placeholder=""
                                v-model="odata.mark"
                            />
                        </dt>
                    </dl>
                </div>
            </div>
            <!--跟踪记录-->
            <div class="record" style="overflow: hidden;">
                <div class="news" v-html="odata.mark"></div>
                <div class="retab">
                    <i></i>
                    <span>跟进记录</span>
                    <button @click="record = true">添加</button>
                </div>
                <div class="recordform" v-show="record">
                    <p>
                        请输入该客户的跟踪记录<span @click="record = false"
                            >x</span
                        >
                    </p>
                    <div>
                        <textarea
                            placeholder="请输入跟踪记录"
                            v-model="gen_text"
                        ></textarea>
                    </div>
                    <button @click="genAddmore">添加</button>
                </div>
                <ul>
                    <dl v-for="(item, index) in genList" :key="index">
                        <dt v-html="item.content"></dt>
                        <dd v-html="item.creationTime"></dd>
                    </dl>
                </ul>
            </div>
            <!--提交-->
            <div style="overflow: hidden;">
                <div
                    class="tijiao"
                    @click="tijiao(0)"
                    style="width: 40%;float: left;margin: 0.5rem 5%;"
                >
                    修改
                </div>
                <div
                    class="tijiao"
                    @click="tijiao(1)"
                    style="width: 40%;float: right;margin: 0.5rem 5%;"
                >
                    提交
                </div>
            </div>
        </div>
    </div>
</template>

<script>
import picker from "../js/picker";
import { Toast } from "mint-ui";
export default {
    components: { picker },
    name: "cusYixiang",
    data() {
        return {
            odata: {
                carBuyType: "",
                carLevel: "",
                carPrice: 0,
                carType: "",
                carYear: 0,
                companyProject: "",
                companyRegistTime: 0,
                companyType: "",
                creator: 0,
                estateArea: "",
                estateFlag: "",
                customType: 1,
                estateRange: "",
                estateStatus: "",
                estateType: "",
                feedBack: "",
                houseType: "",
                loanType: "",
                mark: "",
                mobile: "",
                name: "",
                personalStream: 0,
                safeType: "",
                planStatus: "",
                safePayType: "",
                publicStream: 0,
                safeFlag: "",
                workLocalSocial: "",
                safeCompany: "",
                safeDeposit: 0,
                wantMoney: 0,
                workSalaryType: "",
                wjType: "",
                workAddress: "",
                workLocalProvident: "",
                workAge: 0,
                workCompany: "",
                workOverdue: 0,
                workSalary: 0,
                id: this.$route.query.id
            },
            genList: [],
            gen_text: "",
            aid: 20,
            jianimg: require("../img/jianright.png"),
            daikuan: {},
            zhuzhai: {},
            //房产相关
            fangshow: false,
            fangchan: {},
            estateType: 0,
            fangCertificate: {},
            estateFlag: "",
            fangbuytype: {},
            //车辆相关
            cheshow: false,
            chePeizhi: {},
            cheYear: {},
            cheBytype: {},
            //保单信息
            baodanshow: false,
            baodanType: {},
            baodanJiaotime: {},
            baodanJiaotype: {},
            baodanOver: {},
            //企业信息
            qiyeshow: false,
            qiyeType: {},
            //工作信息
            jobshow: false,
            jobPaywages: {},
            jobSocialsecurity: {},
            jobAccumulationfund: {},

            record: false
        };
    },
    mounted() {
        this.common.login();
        this.daikuan = picker.daikuan;
        this.zhuzhai = picker.zhuzhai;
        this.fangchan = picker.fangchan;
        this.fangCertificate = picker.fangCertificate;
        this.fangbuytype = picker.fangbuytype;
        this.chePeizhi = picker.chePeizhi;
        this.cheYear = picker.cheYear;
        this.cheBytype = picker.cheBytype;
        this.baodanType = picker.baodanType;
        this.baodanJiaotime = picker.baodanJiaotime;
        this.baodanJiaotype = picker.baodanJiaotype;
        this.baodanOver = picker.baodanOver;
        this.qiyeType = picker.qiyeType;
        this.jobPaywages = picker.jobPaywages;
        this.jobSocialsecurity = picker.jobSocialsecurity;
        this.jobAccumulationfund = picker.jobAccumulationfund;
        //根据id获取用户湘西信息
        this.axios({
            method: "get",
            headers: {
                "Content-Type": "application/json"
            },
            url:
                this.common.baseURL +
                "/wxpulic/customInfo/" +
                this.$route.query.id,
            data: {},
            withCredentials: true
        })
            .then(response => {
                //console.log(response.data.code)
                this.common.loginCheak(this, response.data.code); //检测用户信息是否失效
                if (response.data.code == 0) {
                    this.odata = this.qs.parse(response).data.data;
                }
            })
            .catch(error => {
                console.log(error);
            });
        //根据id获取跟进列表
        this.common.getGenjinlist(this, this.$route.query.id);
    },
    methods: {
        pickershow(e) {
            switch (e) {
                case "daikuan":
                    this.$refs.daikuan.show();
                    break;
                case "zhuzhai":
                    this.$refs.zhuzhai.show();
                    break;
                case "fangchan":
                    this.$refs.fangchan.show();
                    break;
                case "fangCertificate":
                    this.$refs.fangCertificate.show();
                    break;
                case "fangbuytype":
                    this.$refs.fangbuytype.show();
                    break;
                case "chePeizhi":
                    this.$refs.chePeizhi.show();
                    break;
                case "cheYear":
                    this.$refs.cheYear.show();
                    break;
                case "cheBytype":
                    this.$refs.cheBytype.show();
                    break;
                case "baodanType":
                    this.$refs.baodanType.show();
                    break;
                case "baodanJiaotime":
                    this.$refs.baodanJiaotime.show();
                    break;
                case "baodanJiaotype":
                    this.$refs.baodanJiaotype.show();
                    break;
                case "baodanOver":
                    this.$refs.baodanOver.show();
                    break;
                case "qiyeType":
                    this.$refs.qiyeType.show();
                    break;
                case "jobPaywages":
                    this.$refs.jobPaywages.show();
                    break;
                case "jobSocialsecurity":
                    this.$refs.jobSocialsecurity.show();
                    break;
                case "jobAccumulationfund":
                    this.$refs.jobAccumulationfund.show();
                    break;
            }
        },
        pickerConfirm(e, data) {
            switch (e) {
                case "daikuan":
                    this.odata.loanType = data[0][0].value;
                    break;
                case "zhuzhai":
                    this.odata.houseType = data[0][0].value;
                    break;
                case "fangchan":
                    this.odata.estateType = data[0][0].value;
                    break;
                case "fangCertificate":
                    this.odata.estateFlag = data[0][0].value;
                    break;
                case "fangbuytype":
                    this.odata.estateStatus = data[0][0].value;
                    break;
                case "chePeizhi":
                    this.odata.carLevel = data[0][0].value;
                    break;
                case "cheYear":
                    this.odata.carYear = data[0][0].value;
                    break;
                case "cheBytype":
                    this.odata.carBuyType = data[0][0].value;
                    break;
                case "baodanType":
                    this.odata.safeType = data[0][0].value;
                    break;
                case "baodanJiaotime":
                    this.odata.safeDeposit = data[0][0].value;
                    break;
                case "baodanJiaotype":
                    this.odata.safePayType = data[0][0].value;
                    break;
                case "baodanOver":
                    this.odata.safeFlag = data[0][0].value;
                    break;
                case "qiyeType":
                    this.odata.companyType = data[0][0].value;
                    break;
                case "jobPaywages":
                    this.odata.workSalaryType = data[0][0].value;
                    break;
                case "jobSocialsecurity":
                    this.odata.workLocalSocial = data[0][0].value;
                    break;
                case "jobAccumulationfund":
                    this.odata.workLocalProvident = data[0][0].value;
                    break;
            }
        },
        //提交修改用户信息
        tijiao(status) {
            let adata = this.odata;
            adata.creationTime = "";
            adata.updateTime = "";
            if (status == 0) {
                adata.customType = 0;
                this.axios({
                    method: "post",
                    url: this.common.baseURL + "/wxpulic/addCustom",
                    headers: {
                        "Content-Type": "application/json"
                    },
                    data: JSON.stringify(adata),
                    withCredentials: true
                })
                    .then(response => {
                        console.log(response);
                        if (response.data.code != 0) {
                            return Toast(response.data.message);
                        } else {
                            Toast("修改成功");
                        }
                    })
                    .catch(error => {
                        console.log(error);
                    });
            } else {
                adata.customType = 1;
                let ostatus = 0;
                //基本信息2
                if (adata.loanType == "" || adata.houseType == "") {
                    return Toast({
                        message: "请贷款类型、住宅类型",
                        position: "center",
                        duration: 2000
                    });
                }
                //房产
                if (
                    adata.estateType == "" ||
                    adata.estateArea == "" ||
                    adata.estateRange == "" ||
                    adata.estateFlag == "" ||
                    adata.estateStatus == ""
                ) {
                    if (
                        adata.estateType == "" &&
                        adata.estateArea == "" &&
                        adata.estateRange == "" &&
                        adata.estateFlag == "" &&
                        adata.estateStatus == ""
                    ) {
                    } else {
                        return Toast({
                            message: "请将房产信息填写完整",
                            position: "center",
                            duration: 2000
                        });
                    }
                } else {
                    ostatus = 1;
                }
                //车辆
                if (
                    adata.carType == "" ||
                    adata.carPrice == 0 ||
                    adata.carLevel == "" ||
                    adata.carBuyType == "" ||
                    adata.carYear == 0
                ) {
                    if (
                        adata.carType == "" &&
                        adata.carPrice == 0 &&
                        adata.carLevel == "" &&
                        adata.carBuyType == "" &&
                        adata.carYear == 0
                    ) {
                    } else {
                        return Toast({
                            message: "请将车辆信息填写完整",
                            position: "center",
                            duration: 2000
                        });
                    }
                } else {
                    ostatus = 1;
                }
                //保单信息
                if (
                    adata.safeCompany == "" ||
                    adata.safeType == "" ||
                    adata.safeDeposit == 0 ||
                    adata.safePayType == "" ||
                    adata.safeFlag == ""
                ) {
                    if (
                        adata.safeCompany == "" &&
                        adata.safeType == "" &&
                        adata.safeDeposit == 0 &&
                        adata.safePayType == "" &&
                        adata.safeFlag == ""
                    ) {
                    } else {
                        return Toast({
                            message: "请将保单信息填写完整",
                            position: "center",
                            duration: 2000
                        });
                    }
                } else {
                    ostatus = 1;
                }
                //企业信息
                if (
                    adata.companyRegistTime == 0 ||
                    adata.companyType == "" ||
                    adata.companyProject == "" ||
                    adata.publicStream == 0 ||
                    adata.personalStream == 0
                ) {
                    if (
                        adata.companyRegistTime == 0 &&
                        adata.companyType == "" &&
                        adata.companyProject == "" &&
                        adata.publicStream == 0 &&
                        adata.personalStream == 0
                    ) {
                    } else {
                        return Toast({
                            message: "请将企业信息填写完整",
                            position: "center",
                            duration: 2000
                        });
                    }
                } else {
                    ostatus = 1;
                }
                //工作信息
                if (
                    adata.workAddress == "" ||
                    adata.workSalaryType == "" ||
                    adata.workSalary == 0 ||
                    adata.workAge == 0 ||
                    adata.workLocalSocial == "" ||
                    adata.workLocalProvident == ""
                ) {
                    if (
                        adata.workAddress == "" &&
                        adata.workSalaryType == "" &&
                        adata.workSalary == 0 &&
                        adata.workAge == 0 &&
                        adata.workLocalSocial == "" &&
                        adata.workLocalProvident == ""
                    ) {
                    } else {
                        return Toast({
                            message: "请将工作信息填写完整",
                            position: "center",
                            duration: 2000
                        });
                    }
                } else {
                    ostatus = 1;
                }
                //逾期情况
                // if(adata.workOverdue==""){
                //     return Toast({
                //         message: '请将逾期情况填写完整',
                //         position: 'center',
                //         duration: 2000
                //     });
                // }
                console.log(ostatus);
                if (ostatus == 0) {
                    Toast({
                        message: "请填写完整信息",
                        position: "center",
                        duration: 2000
                    });
                    return;
                }
                this.axios({
                    method: "patch",
                    url: this.common.baseURL + "/wxpulic/submitCustom",
                    headers: {
                        "Content-Type": "application/json"
                    },
                    data: JSON.stringify(adata),
                    withCredentials: true
                })
                    .then(response => {
                        console.log(response);
                        if (response.data.code != 0) {
                            return Toast(response.data.message);
                        } else {
                            this.$router.push("/customer");
                            Toast("提交成功");
                        }
                    })
                    .catch(error => {
                        console.log(error);
                    });
            }
        },
        //添加客户跟进记录
        genAddmore() {
            if (this.gen_text == "") {
                return;
            }
            this.axios({
                method: "post",
                url: this.common.baseURL + "/wxpulic/customFollow",
                headers: {
                    "Content-Type": "application/json"
                },
                data: JSON.stringify({
                    content: this.gen_text,
                    customId: this.$route.query.id
                }),
                withCredentials: true
            })
                .then(response => {
                    console.log(response);
                    if (response.data.code != 0) {
                        return Toast(response.data.message);
                    } else {
                        Toast("提交成功");
                        this.common.getGenjinlist(this, this.$route.query.id);
                        this.record = false;
                    }
                })
                .catch(error => {
                    console.log(error);
                });
        }
    }
};
</script>

<style scoped lang="less">
html,
body,
#app,
.body {
    width: 100%;
    height: auto;
    overflow: hidden;
}
@import "../style/form.less";
</style>
